package com.atguigu.yygh.sta.controller;

import com.atguigu.yygh.order.OrderFeignClient;
import com.atguigu.yygh.result.R;
import com.atguigu.yygh.vo.order.OrderCountQueryVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/*==========================================
      时 间:   2022-04-29
      讲 师:   刘  辉
      描 述:   尚硅谷教学团队
 ==========================================*/
@Api(tags = "统计管理接口")
@RestController
@RequestMapping("/admin/sta")
public class StatisticController {

    @Autowired
    private OrderFeignClient orderFeignClient;


    @GetMapping("/info")
    public R getStatistics(OrderCountQueryVo orderCountQueryVo){
        Map<String, Object> statistics = orderFeignClient.getStatistics(orderCountQueryVo);
        return R.ok().data(statistics);
    }
}
